package org.arabidopsis.plantCyc;

import java.security.spec.ECField;
import java.util.NoSuchElementException;

import org.biojava.bio.BioException;
import org.biojavax.bio.seq.RichSequence;
import org.biojavax.bio.seq.RichSequenceIterator;

public class DistancesTable {

	/**
	 * @param args
	 * @throws BioException 
	 * @throws NoSuchElementException 
	 */
	public static void generateFromFiles(String[] args) throws NoSuchElementException, BioException {
		for (int i = 0; i < args.length; i++) {			
			FastaSeqIterator fastaSeqIter=new FastaSeqIterator( args[i]);
			while (fastaSeqIter.hasNext())
			{
				RichSequence currentSeq=fastaSeqIter.nextRichSequence();
				System.out.println(currentSeq.getAccession()+ " " + currentSeq.getDescription());
				ECnumber currentECnumber=new ECnumber(currentSeq.getDescription());
				System.out.println(currentECnumber);
				//System.out.println(currentSeq.seqString());
			}
		}
	}

	public static void generateFromFilesInDir(String dir, String[] args) throws NoSuchElementException, BioException {
		generateFromFiles(genFullPaths(dir, args));
	}

	public static String[] genFullPaths(String dir, String[] args) {
		String [] filesList=new String[args.length];
		for (int i = 0; i < args.length; i++) {	
			filesList[i]=dir+args[i];
		}
		return filesList;
	}
	
	public static void main(String[] args) throws NoSuchElementException, BioException {
		String [] fileList={"1___BRENDA_sequences.txt",
//				"2___BRENDA_sequences.txt",
//				"3___BRENDA_sequences.txt",
//				"4___BRENDA_sequences.txt",
				"5___BRENDA_sequences.txt"};
		String enzDBpath="/home/ozgur/brenda/";
		generateFromFilesInDir(enzDBpath,fileList);	
	}
}
